import {Injectable} from '@angular/core';
import {Observable, Subject} from "rxjs";
import {delay} from "rxjs/operators";

@Injectable({
  providedIn: 'root'
})
export class IndexSideBarService {

  private _sideBar = new Subject<string>();

  public sideBar$: Observable<string>;

  constructor() {
    this.sideBar$ = this._sideBar.asObservable().pipe(delay(1));
  }

  toggle(flag: string) {
    this._sideBar.next(flag)
  }

  public static close_flag = 'close';
  public static open_flag = 'open';
}
